package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.request.IeoStagesRequest;
import com.novax.ex.activity.open.model.response.IeoStagesResponse;
import com.novax.ex.common.results.ReturnResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;

import jakarta.validation.Valid;
import java.util.List;

/**
 * @Description ieo分期配置
 * @Author ChenXi
 * @Date 2023/05/10/16:50
 */

@Tag(name = "IEO后台-分期配置", description = "IEO后台-分期配置")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "IeoStagesApi", contextId = "IeoStagesApi")
@RequestMapping
public interface IeoStagesApi {

    @Operation(summary = "分期配置")
    @PostMapping({"/v3/private/ieo/stages/{ieoId}"})
    ReturnResult<?> stages(@RequestHeader("language") String language,
                           @Valid @RequestBody List<IeoStagesRequest> ieoStagesRequestList,
                           @PathVariable Long ieoId,
                           BindingResult bindingResult);

    @Operation(summary = "配置查询")
    @GetMapping("/v3/private/ieo/stages/query")
    ReturnResult<List<IeoStagesResponse>> query(@RequestHeader("language") String language, Long ieoId);
}
